package com.itheima.Mapper;

import com.itheima.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    //@Select("select * from user")
    public List<User> findAll();

    @Delete("delete from user where id = #{id}")
    public Integer deleteById(Integer id);

    @Insert("insert into user(nusername,password,name,age) VALUE (#{username},#{password},#{name},#{age})")
    void insertUser(User user);

    @Update("update user set username = #{username},passwrod = #{passwrod},name = #{name},age =#{age}")
    void updateUser(User user);

    @Select("select * from user where username =#{username} and password = #{password} ")
    public User findByUsernameAndPassword(@Param("username") String username,@Param("password") String password);
}
